package com.ccit.common.exception;

import com.ccit.common.result.ResultCodeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@ApiModel(value = "自定义全局异常类")
@AllArgsConstructor//有参
@NoArgsConstructor//无参
public class GymException extends RuntimeException {
    /**
     * 返回code
     */
    @ApiModelProperty(value = "异常状态码")
    private Integer code;
    /**
     * 返回msg
     */
    @ApiModelProperty(value = "异常状态信息")
    private String message;

   /* public GymException(Integer code, String message) {
        super(message);
        this.code = code;
    }

    public GymException(ResultCodeEnum resultCodeEnum) {
        super(resultCodeEnum.getMessage());
        this.code = resultCodeEnum.getCode();
    }

    public Integer getCode() {
        return code;
    }*/


}
